{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication\Log\3_4_CMP_PRITM_Appendix_Dalton.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}29 Aug 2024, 15:43:07

{com}. do "C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication\Do\3_4_CMP_PRITM_Appendix_Dalton.do"
{txt}
{com}. *****************************************************************************
. * Cleaning and Analyzing - PRITM countries. Alternative proxy                           *
. *   . Polarization proxy as Dalton Index                                    *
. *                                               Manifesto Project Database                          *
. *                                                                                                                                           *
. * Author:                       Valentina Gonzalez-Rostani                                                      *
. * Contact:                      mag384@pitt.edu                                                                 *
. * Date:                         March 21 2021                                                                           *
. * Version:                      Stata 17                                                                        *
. *                                                                                                                                                       *
. *****************************************************************************
. 
. /*
> This do-file:
>         A. Call the Data
>         B. Define variables
>         C. Export Tables 
> 
> Input: ** Manifesto Project database**
>         - Data\CMP\MPDataset_MPDS2020a_stata14.dta // Data download from https://manifesto-project.wzb.eu/datasets 2021
> 
> 
> Final output:
>         Cleaned data: 
>                 * "Data\CMP_Dalton.dta" this data contains the relevant variables for the analysis with the DV as the polarization over redistribution, and fixed-value positions, estimated as Dalton index
>         Tables:
>                 * table A22: Partisan Polarization over Redistribution and Fixed Attributes, Dalton Index
> 
> 
> */
. cd "C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication" // Only change your directory
{res}C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication
{txt}
{com}. 
. * Processing of the data (alternatively skip and go to line 175)
. {c -(}
. *##########################################
. * A. Calling the data
. *##########################################
. {c -(}
. 
. use "Data\CMP\MPDataset_MPDS2020a_stata14.dta", replace
{txt}(Manifesto Project Dataset Version 2020a. Please type "notes" for more details)
{com}. 
. {c )-}
. 
. *############################################
. * B. Creating Variables
. *############################################
. {c -(}
. * YEAR
. gen year = year(edate) 
. 
. * Keep countries of interest
. keep if countryname=="Australia" |  countryname=="Canada" |  countryname=="Greece" |  countryname=="New Zealand" |  countryname=="Portugal" |  countryname=="Spain" |  countryname=="United Kingdom" |  countryname=="United States" |  countryname=="France" |  countryname=="Norway" | countryname=="Austria" | countryname=="Belgium" | countryname=="Denmark" | countryname=="Estonia" | countryname=="Finland" | countryname=="Hungary" | countryname=="Germany" | countryname=="Iceland"  | countryname=="Ireland"  | countryname=="Italy"  | countryname=="Netherlands"  | countryname=="Norway" | countryname=="Slovakia" | countryname=="Slovenia" | countryname=="Sweden" | countryname=="Switzerland"
{txt}(1,682 observations deleted)
{com}. 
. * Defines a dummy to identify PRITM countries
. gen PRITM=. 
{txt}(2,900 missing values generated)
{com}. replace PRITM=0 if countryname=="Australia"
{txt}(111 real changes made)
{com}. replace PRITM=0 if countryname=="Canada"
{txt}(94 real changes made)
{com}. replace PRITM=0 if countryname=="Greece"
{txt}(84 real changes made)
{com}. replace PRITM=0 if countryname=="New Zealand"
{txt}(101 real changes made)
{com}. replace PRITM=0 if countryname=="Portugal"
{txt}(101 real changes made)
{com}. replace PRITM=0 if countryname=="Spain"
{txt}(157 real changes made)
{com}. replace PRITM=0 if countryname=="United Kingdom"
{txt}(98 real changes made)
{com}. replace PRITM=0 if countryname=="United States"
{txt}(53 real changes made)
{com}. replace PRITM=0 if countryname=="France"
{txt}(116 real changes made)
{com}. 
. replace PRITM=1 if countryname=="Austria"
{txt}(83 real changes made)
{com}. replace PRITM=1 if countryname=="Belgium"
{txt}(184 real changes made)
{com}. replace PRITM=1 if countryname=="Denmark"
{txt}(235 real changes made)
{com}. replace PRITM=1 if countryname=="Estonia"
{txt}(47 real changes made)
{com}. replace PRITM=1 if countryname=="Finland"
{txt}(162 real changes made)
{com}. replace PRITM=1 if countryname=="Germany"
{txt}(89 real changes made)
{com}. replace PRITM=1 if countryname=="Hungary"
{txt}(43 real changes made)
{com}. replace PRITM=1 if countryname=="Iceland"
{txt}(117 real changes made)
{com}. replace PRITM=1 if countryname=="Ireland"
{txt}(103 real changes made)
{com}. replace PRITM=1 if countryname=="Italy"
{txt}(178 real changes made)
{com}. replace PRITM=1 if countryname=="Netherlands"
{txt}(178 real changes made)
{com}. replace PRITM=1 if countryname=="Norway"
{txt}(130 real changes made)
{com}. replace PRITM=1 if countryname=="Slovenia"
{txt}(72 real changes made)
{com}. replace PRITM=1 if countryname=="Slovakia"
{txt}(69 real changes made)
{com}. replace PRITM=1 if countryname=="Sweden"
{txt}(137 real changes made)
{com}. replace PRITM=1 if countryname=="Switzerland"
{txt}(158 real changes made)
{com}. 
. 
. * CONTROL VARIABLES - number of parties
. 
. gen number = 1
. egen number2= sum(number), by(edate)
. lab var number2 "Number of parties"
. 
. *############################################################
. * DEPENDENT VARIABLE Redistribution and Fixed Attributes
. *############################################################
. {c -(}
. * Obtaining relevant policy variables
. 
. gen welfare_policy =  ln(per504+0.5) - ln(per505+0.5)
{txt}(7 missing values generated)
{com}. 
. gen fixed = .
{txt}(2,900 missing values generated)
{com}. replace fixed = (ln(per107+per108+per407+per602+0.5+per602_2)-ln(per109+per110+per406+per601+0.5+per601_2)) if !missing(per602_2) & !missing(per601_2)
{txt}(333 real changes made)
{com}. replace fixed = (ln(per107+per108+per407+per602+0.5)-ln(per109+per110+per406+per601+0.5)) if missing(per602_2) | missing(per601_2)
{txt}(2,560 real changes made)
{com}. 
. {c )-}
. 
. ** Different code compared to 3_2 do file: 
. ***** Now Dalton Index
. {c -(}
. egen pervote_e= sum(pervote), by(edate partyname)
. 
. foreach x of varlist welfare_policy fixed  {c -(}
{txt}  2{com}. 
. egen `x'_av= mean(`x'), by(edate countryname)
{txt}  3{com}. {c )-}       
. 
. foreach x of varlist welfare_policy fixed  {c -(}
{txt}  2{com}. 
. gen `x'_d= pervote_e*(`x'-`x'_av)^2
{txt}  3{com}. {c )-}
{txt}(7 missing values generated)
(7 missing values generated)
{com}. 
. foreach x of varlist welfare_policy fixed  {c -(}
{txt}  2{com}. 
. egen `x'_dt= sum(`x'_d), by(edate countryname)
{txt}  3{com}. gen `x'_dt2= (`x'_dt)^0.5
{txt}  4{com}. {c )-}       
. {c )-}
. 
. * Collapsing the data 
. {c -(}
. collapse (first) year  PRITM  totseats number2 oecdmember date *_dt2 *_dt , by(edate countryname)
{res}{com}. {c )-}
. // Final Prep of the data
. {c -(}
. egen country_number = group(countryname)
. 
. sort country_number edate
. bysort country_number: gen election_order=_n
. xtset country_number election_order
{res}
{col 1}{txt:Panel variable: }{res:country_number}{txt: (unbalanced)}
{p 1 16 2}{txt:Time variable: }{res:election_order}{txt:, }{res:{bind:1}}{txt: to }{res:{bind:28}}{p_end}
{txt}{col 10}Delta: {res}1 unit
{com}. 
. 
. sort countryname  election_order
. 
. 
. 
. 
. sort countryname  year
. 
. gen shock=.
{txt}(474 missing values generated)
{com}. replace shock =0 if year > 1969 & year < 1995
{txt}(166 real changes made)
{com}. replace shock =1 if  year > 1994
{txt}(167 real changes made)
{com}. xtset country_number election_order
{res}
{col 1}{txt:Panel variable: }{res:country_number}{txt: (unbalanced)}
{p 1 16 2}{txt:Time variable: }{res:election_order}{txt:, }{res:{bind:1}}{txt: to }{res:{bind:28}}{p_end}
{txt}{col 10}Delta: {res}1 unit
{com}. {c )-}
. {c )-}
. *############################################
. * Saving the data
. *############################################
. {c -(}
. lab var PRITM "PR with Trichotomous Multipartism"
. lab var totseats "Total Number of Seats"
. lab var number2 "Total Number of Parties"
. lab var oecdmember "OECD member"
. lab var welfare_policy_dt2 "Distance Redistribution (DR) - Net Welfare"
. lab var fixed_dt2 "Distance Fixed-Value Positions (DFVP) - Net Anti-Global"
. lab var PRITM "PRITM"
. lab var shock "High LMP period" // post 1994
. 
. keep  PRITM year  countryname  oecdmember totseats shock welfare_policy_dt2 fixed_dt2   number2 election_order country_number
. 
. keep if year>1969
{txt}(141 observations deleted)
{com}. keep if PRITM==1
{txt}(131 observations deleted)
{com}. 
. save "Data\CMP_Dalton.dta", replace
{txt}{p 0 4 2}
file {bf}
Data\CMP_Dalton.dta{rm}
saved
{p_end}
{com}. 
. {c )-}
. {c )-}
{txt}
{com}. * Alternatively load prepared data
. {c -(}
. use "Data\CMP_Dalton.dta", clear        
{txt}(Manifesto Project Dataset Version 2020a. Please type "notes" for more details)
{com}. {c )-}
{txt}
{com}. *##########################################
. * Analysis
. *##########################################
. {c -(}
. // table A22: Partisan Polarization over Redistribution and Fixed Attributes, Dalton Index
. {c -(}
. preserve
. keep if PRITM==1
{txt}(0 observations deleted)
{com}.    keep if year>1969 
{txt}(0 observations deleted)
{com}. 
. eststo clear
. // Redistribution
. eststo: qui reg welfare_policy_dt2 L.welfare_policy_dt2 shock totseats  oecdmember  number2 i.year, cluster(countryname)
{txt}({res}est1{txt} stored)
{com}. eststo: qui reg fixed_dt2 L.fixed_dt2 shock totseats  oecdmember  number2 i.year, cluster(countryname)
{txt}({res}est2{txt} stored)
{com}. 
. 
. 
. esttab , replace label se title(Polarization over Redistribution and Fixed Attributes between Mainstream Left and Right-Populist \label {c -(}TableCMPAllFE{c )-}) mti("Redistribution" "Fixed Values" "Redistribution" "Fixed Values" ) compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.3f) keep(shock ) scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("Controls = tots*" "LDV = L.*" "FE Year = *year") 
{res}
{txt}Polarization over Redistribution and Fixed Attributes between Mainstream Left and Right-Populist \label {TableCMPAllFE}
{txt}{hline 42}
{txt}                       (1)          (2)   
{txt}                 Redistr~n    Fixed V~s   
{txt}{hline 42}
{txt}High LMP period {res}   -12.476***     9.747***{txt}
                {res} {ralign 9:{txt:(}2.216{txt:)}}    {ralign 9:{txt:(}1.003{txt:)}}   {txt}
{txt}Controls        {res}       Yes          Yes   {txt}
{txt}LDV             {res}       Yes          Yes   {txt}
{txt}FE Year         {res}       Yes          Yes   {txt}
{txt}{hline 42}
{txt}Observations    {res}       186          186   {txt}
{txt}R$^2$           {res}     0.384        0.401   {txt}
{txt}AIC             {res}  1074.384     1031.899   {txt}
{txt}{hline 42}
{txt}Standard errors in parentheses
{txt}* p<0.1, ** p<0.05, *** p<0.01
{com}. 
. esttab using "Table\TabWithindalton.tex", replace label se title(Polarization over Redistribution and Fixed Attributes, Dalton Index \label {c -(}TabWithindalton{c )-}) mti("Redistribution" "Fixed Values" "Redistribution" "Fixed Values" ) compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.3f) keep(shock ) scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("Controls = tots*" "LDV = L.*" "FE Year = *year") 
{res}{txt}(output written to {browse  `"Table\TabWithindalton.tex"'})
{com}. 
. 
. 
. restore
. {c )-}
. {c )-}
{txt}
{com}. 
{txt}end of do-file

{com}. exit, clear
